const fs = require('fs')

const ds = fs.readFileSync('1.json').toString()

const dss = JSON.parse(ds)

dss.map((i, k) => {
  const date = i.createdAt.split('T')[0]
  if (k === 0) {
    i.date = date
  } else {
    const before = dss[k - 1].createdAt.split('T')[0]
    if (before !== date) {
      i.date = date
    }
  }
  console.error(i.date)
  return i
})
